<!DOCTYPE html><html lang="zh-CN"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=2"><meta name="theme-color" content="#222"><meta name="generator" content="Hexo 3.9.0"><link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon.ico"><link rel="icon" type="image/png" sizes="16x16" href="/favicon.ico"><link rel="mask-icon" href="/images/logo.svg" color="#222"><meta name="baidu-site-verification" content="WIIeufYjj6"><link rel="stylesheet" href="/css/main.css"><link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css"><script id="hexo-configurations">var NexT=window.NexT||{},CONFIG={hostname:new URL("http://winddoing.github.io").hostname,root:"/",scheme:"Mist",version:"7.7.0",exturl:!1,sidebar:{position:"right",width:300,display:"post",padding:18,offset:12,onmobile:!1},copycode:{enable:!0,show_result:!1,style:"flat"},back2top:{enable:!0,sidebar:!1,scrollpercent:!1},bookmark:{enable:!1,color:"#222",save:"auto"},fancybox:!1,mediumzoom:!1,lazyload:!1,pangu:!1,comments:{style:"tabs",active:"livere",storage:!0,lazyload:!1,nav:null,activeClass:"livere"},algolia:{appID:"OWFNL0AG1F",apiKey:"796a4b50e2653330cac4e0f8b1f8ade4",indexName:"winddoing",hits:{per_page:10},labels:{input_placeholder:"输入关键词",hits_empty:"没有找到与「${query}」相关的内容",hits_stats:"${hits} 条相关记录，共耗时 ${time} ms"}},localsearch:{enable:!0,trigger:"auto",top_n_per_article:1,unescape:!1,preload:!1},path:"search.xml",motion:{enable:!0,async:!1,transition:{post_block:"fadeIn",post_header:"slideDownIn",post_body:"slideDownIn",coll_header:"slideLeftIn",sidebar:"slideUpIn"}}}</script><meta name="description" content="解析wpa_supplicant的配置文件，一般叫做 wpa_supplicant.conf 在wpa_supplicant的源码中都有配置文件的示例wpa_supplicant.conf"><meta name="keywords" content="WIFI"><meta property="og:type" content="article"><meta property="og:title" content="wpa_supplicant源码分析--conf配置文件"><meta property="og:url" content="http://winddoing.github.io/post/50085.html"><meta property="og:site_name" content="Winddoing&#39;s Blog"><meta property="og:description" content="解析wpa_supplicant的配置文件，一般叫做 wpa_supplicant.conf 在wpa_supplicant的源码中都有配置文件的示例wpa_supplicant.conf"><meta property="og:locale" content="zh-CN"><meta property="og:updated_time" content="2020-07-04T09:34:15.244Z"><meta name="twitter:card" content="summary"><meta name="twitter:title" content="wpa_supplicant源码分析--conf配置文件"><meta name="twitter:description" content="解析wpa_supplicant的配置文件，一般叫做 wpa_supplicant.conf 在wpa_supplicant的源码中都有配置文件的示例wpa_supplicant.conf"><link rel="canonical" href="http://winddoing.github.io/post/50085.html"><script id="page-configurations">CONFIG.page={sidebar:"",isHome:!1,isPost:!0}</script><link rel="stylesheet" href="//cdn.jsdelivr.net/gh/theme-next/theme-next-needmoreshare2@1/needsharebutton.min.css"><style>#needsharebutton-postbottom{cursor:pointer;height:26px;margin-top:10px;position:relative}#needsharebutton-postbottom .btn{border:1px solid $btn-default-border-color;border-radius:3px;display:initial;padding:1px 4px}</style><title>wpa_supplicant源码分析--conf配置文件 | Winddoing's Blog</title><script>var _hmt=_hmt||[];!function(){var e=document.createElement("script");e.src="https://hm.baidu.com/hm.js?38fa95924670925239ef842cb0c8722b";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)}()</script><noscript><style>.sidebar-inner,.use-motion .brand,.use-motion .collection-header,.use-motion .comments,.use-motion .menu-item,.use-motion .pagination,.use-motion .post-block,.use-motion .post-body,.use-motion .post-header{opacity:initial}.use-motion .site-subtitle,.use-motion .site-title{opacity:initial;top:initial}.use-motion .logo-line-before i{left:initial}.use-motion .logo-line-after i{right:initial}</style></noscript></head><body itemscope itemtype="http://schema.org/WebPage"><div class="container use-motion"><div class="headband"></div><header class="header" itemscope itemtype="http://schema.org/WPHeader"><div class="header-inner"><div class="site-brand-container"><div class="site-meta"><div><a href="/" class="brand" rel="start"><span class="logo-line-before"><i></i></span> <span class="site-title">Winddoing's Blog</span><span class="logo-line-after"><i></i></span></a></div><h1 class="site-subtitle" itemprop="description">Follow Excellent, Success will Chase you</h1></div><div class="site-nav-toggle"><div class="toggle" aria-label="切换导航栏"><span class="toggle-line toggle-line-first"></span><span class="toggle-line toggle-line-middle"></span><span class="toggle-line toggle-line-last"></span></div></div></div><nav class="site-nav"><ul id="menu" class="menu"><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-fw fa-home"></i> 首页</a></li><li class="menu-item menu-item-tags"><a href="/tags/" rel="section"><i class="fa fa-fw fa-tags"></i> 标签</a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="fa fa-fw fa-th"></i> 分类</a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i> 归档</a></li><li class="menu-item menu-item-about"><a href="/about/" rel="section"><i class="fa fa-fw fa-user"></i> 关于</a></li><li class="menu-item menu-item-search"><a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i> 搜索</a></li></ul></nav><div class="site-search"><div class="popup search-popup"><div class="search-header"><span class="search-icon"><i class="fa fa-search"></i></span><div class="search-input-container"> <input autocomplete="off" autocorrect="off" autocapitalize="none" placeholder="搜索..." spellcheck="false" type="text" id="search-input"></div><span class="popup-btn-close"><i class="fa fa-times-circle"></i></span></div><div id="search-result"></div></div><div class="search-pop-overlay"></div></div></div></header><div class="back-to-top"><i class="fa fa-arrow-up"></i> <span>0%</span></div><main class="main"><div class="main-inner"><div class="content-wrap"><div class="content"><div class="posts-expand"><article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN"><link itemprop="mainEntityOfPage" href="http://winddoing.github.io/post/50085.html"><span hidden itemprop="author" itemscope itemtype="http://schema.org/Person"><meta itemprop="image" content="/images/Winddoing.jpg"><meta itemprop="name" content="Winddoing"><meta itemprop="description" content="失败缘于忽视细处，成功始于重视小事。"></span><span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization"><meta itemprop="name" content="Winddoing's Blog"></span><header class="post-header"><h2 class="post-title" itemprop="name headline"> wpa_supplicant源码分析--conf配置文件</h2><div class="post-meta"><span class="post-meta-item"><span class="post-meta-item-icon"><i class="fa fa-calendar-o"></i></span> <span class="post-meta-item-text">发表于</span> <time title="创建时间：2018-11-28 16:00:00" itemprop="dateCreated datePublished" datetime="2018-11-28T16:00:00+08:00">2018-11-28</time></span><span class="post-meta-item"><span class="post-meta-item-icon"><i class="fa fa-folder-o"></i></span> <span class="post-meta-item-text">分类于</span> <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/网络/" itemprop="url" rel="index"><span itemprop="name">网络</span></a></span> ， <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/网络/WIFI/" itemprop="url" rel="index"><span itemprop="name">WIFI</span></a></span></span><span id="/post/50085.html" class="post-meta-item leancloud_visitors" data-flag-title="wpa_supplicant源码分析--conf配置文件" title="阅读次数"><span class="post-meta-item-icon"><i class="fa fa-eye"></i></span> <span class="post-meta-item-text">阅读次数：</span><span class="leancloud-visitors-count"></span></span><span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv" style="display:none"><span class="post-meta-item-icon"><i class="fa fa-eye"></i></span> <span class="post-meta-item-text">阅读次数：</span><span id="busuanzi_value_page_pv"></span></span><br><span class="post-meta-item" title="本文字数"><span class="post-meta-item-icon"><i class="fa fa-file-word-o"></i></span> <span class="post-meta-item-text">本文字数：</span> <span>34k</span></span><span class="post-meta-item" title="阅读时长"><span class="post-meta-item-icon"><i class="fa fa-clock-o"></i></span> <span class="post-meta-item-text">阅读时长 &asymp;</span> <span>31 分钟</span></span></div></header><div class="post-body" itemprop="articleBody"><p>解析wpa_supplicant的配置文件，一般叫做 <code>wpa_supplicant.conf</code></p><p>在wpa_supplicant的源码中都有配置文件的示例<a href="http://w1.fi/cgit/hostap/plain/wpa_supplicant/wpa_supplicant.conf" target="_blank" rel="noopener">wpa_supplicant.conf</a></p><a id="more"></a><h2 id="wpa-supplicant-conf"><a href="#wpa-supplicant-conf" class="headerlink" title="wpa_supplicant.conf"></a>wpa_supplicant.conf</h2><p>当前项目中使用到的一个配置文件</p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line">ctrl_interface=/var/run/sockets</span><br><span class="line">driver_param=use_p2p_group_interface=1p2p_device=1</span><br><span class="line">update_config=1</span><br><span class="line">device_name=V_9ca2</span><br><span class="line">device_type=10-0050F204-5</span><br><span class="line">config_methods=virtual_push_button physical_display keypad</span><br><span class="line">p2p_go_intent=15</span><br><span class="line">p2p_ssid_postfix=-V_9ca2</span><br><span class="line">persistent_reconnect=1</span><br><span class="line"></span><br><span class="line">network=&#123;</span><br><span class="line">  ssid=&quot;D-H-V_9ca2&quot;</span><br><span class="line">  bssid=ae:83:f3:b4:9c:a2</span><br><span class="line">  psk=&quot;00000000&quot;</span><br><span class="line">  proto=RSN</span><br><span class="line">  key_mgmt=WPA-PSK</span><br><span class="line">  pairwise=CCMP</span><br><span class="line">  auth_alg=OPEN</span><br><span class="line">  mode=3</span><br><span class="line">  disabled=2</span><br><span class="line">  p2p_client_list=1a:f0:e4:87:fb:74 ac:83:f3:b3:72:24 04:e6:76:c3:37:84</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><blockquote><p>该配置文件用于p2p</p></blockquote><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">wpa_supplicant -iwlan0 -s -Dnl80211 -O/var/run/sockets -c/etc/wifi/p2p_supplicant.conf</span><br></pre></td></tr></table></figure><ul><li><code>-D</code>: 指定使用的wifi驱动, nl80211 = Linux nl80211/cfg80211</li><li><code>-i</code>: 指定端口</li><li><code>-C</code>: 指定配置文件</li><li><code>-O</code>: 覆盖新接口的ctrl_interface参数</li></ul><h2 id="配置文件解析"><a href="#配置文件解析" class="headerlink" title="配置文件解析"></a>配置文件解析</h2><p>以下的数据结构都是从<code>wpa_supplicant_8</code>中的源码获取.</p><blockquote><p><code>8</code>支持建立热点(hostapd)</p></blockquote><h3 id="可配置参数"><a href="#可配置参数" class="headerlink" title="可配置参数"></a>可配置参数</h3><p>wpa_supplicant的所有参数都定义在struct wpa_config中</p><figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br><span class="line">201</span><br><span class="line">202</span><br><span class="line">203</span><br><span class="line">204</span><br><span class="line">205</span><br><span class="line">206</span><br><span class="line">207</span><br><span class="line">208</span><br><span class="line">209</span><br><span class="line">210</span><br><span class="line">211</span><br><span class="line">212</span><br><span class="line">213</span><br><span class="line">214</span><br><span class="line">215</span><br><span class="line">216</span><br><span class="line">217</span><br><span class="line">218</span><br><span class="line">219</span><br><span class="line">220</span><br><span class="line">221</span><br><span class="line">222</span><br><span class="line">223</span><br><span class="line">224</span><br><span class="line">225</span><br><span class="line">226</span><br><span class="line">227</span><br><span class="line">228</span><br><span class="line">229</span><br><span class="line">230</span><br><span class="line">231</span><br><span class="line">232</span><br><span class="line">233</span><br><span class="line">234</span><br><span class="line">235</span><br><span class="line">236</span><br><span class="line">237</span><br><span class="line">238</span><br><span class="line">239</span><br><span class="line">240</span><br><span class="line">241</span><br><span class="line">242</span><br><span class="line">243</span><br><span class="line">244</span><br><span class="line">245</span><br><span class="line">246</span><br><span class="line">247</span><br><span class="line">248</span><br><span class="line">249</span><br><span class="line">250</span><br><span class="line">251</span><br><span class="line">252</span><br><span class="line">253</span><br><span class="line">254</span><br><span class="line">255</span><br><span class="line">256</span><br><span class="line">257</span><br><span class="line">258</span><br><span class="line">259</span><br><span class="line">260</span><br><span class="line">261</span><br><span class="line">262</span><br><span class="line">263</span><br><span class="line">264</span><br><span class="line">265</span><br><span class="line">266</span><br><span class="line">267</span><br><span class="line">268</span><br><span class="line">269</span><br><span class="line">270</span><br><span class="line">271</span><br><span class="line">272</span><br><span class="line">273</span><br><span class="line">274</span><br><span class="line">275</span><br><span class="line">276</span><br><span class="line">277</span><br><span class="line">278</span><br><span class="line">279</span><br><span class="line">280</span><br><span class="line">281</span><br><span class="line">282</span><br><span class="line">283</span><br><span class="line">284</span><br><span class="line">285</span><br><span class="line">286</span><br><span class="line">287</span><br><span class="line">288</span><br><span class="line">289</span><br><span class="line">290</span><br><span class="line">291</span><br><span class="line">292</span><br><span class="line">293</span><br><span class="line">294</span><br><span class="line">295</span><br><span class="line">296</span><br><span class="line">297</span><br><span class="line">298</span><br><span class="line">299</span><br><span class="line">300</span><br><span class="line">301</span><br><span class="line">302</span><br><span class="line">303</span><br><span class="line">304</span><br><span class="line">305</span><br><span class="line">306</span><br><span class="line">307</span><br><span class="line">308</span><br><span class="line">309</span><br><span class="line">310</span><br><span class="line">311</span><br><span class="line">312</span><br><span class="line">313</span><br><span class="line">314</span><br><span class="line">315</span><br><span class="line">316</span><br><span class="line">317</span><br><span class="line">318</span><br><span class="line">319</span><br><span class="line">320</span><br><span class="line">321</span><br><span class="line">322</span><br><span class="line">323</span><br><span class="line">324</span><br><span class="line">325</span><br><span class="line">326</span><br><span class="line">327</span><br><span class="line">328</span><br><span class="line">329</span><br><span class="line">330</span><br><span class="line">331</span><br><span class="line">332</span><br><span class="line">333</span><br><span class="line">334</span><br><span class="line">335</span><br><span class="line">336</span><br><span class="line">337</span><br><span class="line">338</span><br><span class="line">339</span><br><span class="line">340</span><br><span class="line">341</span><br><span class="line">342</span><br><span class="line">343</span><br><span class="line">344</span><br><span class="line">345</span><br><span class="line">346</span><br><span class="line">347</span><br><span class="line">348</span><br><span class="line">349</span><br><span class="line">350</span><br><span class="line">351</span><br><span class="line">352</span><br><span class="line">353</span><br><span class="line">354</span><br><span class="line">355</span><br><span class="line">356</span><br><span class="line">357</span><br><span class="line">358</span><br><span class="line">359</span><br><span class="line">360</span><br><span class="line">361</span><br><span class="line">362</span><br><span class="line">363</span><br><span class="line">364</span><br><span class="line">365</span><br><span class="line">366</span><br><span class="line">367</span><br><span class="line">368</span><br><span class="line">369</span><br><span class="line">370</span><br><span class="line">371</span><br><span class="line">372</span><br><span class="line">373</span><br><span class="line">374</span><br><span class="line">375</span><br><span class="line">376</span><br><span class="line">377</span><br><span class="line">378</span><br><span class="line">379</span><br><span class="line">380</span><br><span class="line">381</span><br><span class="line">382</span><br><span class="line">383</span><br><span class="line">384</span><br><span class="line">385</span><br><span class="line">386</span><br><span class="line">387</span><br><span class="line">388</span><br><span class="line">389</span><br><span class="line">390</span><br><span class="line">391</span><br><span class="line">392</span><br><span class="line">393</span><br><span class="line">394</span><br><span class="line">395</span><br><span class="line">396</span><br><span class="line">397</span><br><span class="line">398</span><br><span class="line">399</span><br><span class="line">400</span><br><span class="line">401</span><br><span class="line">402</span><br><span class="line">403</span><br><span class="line">404</span><br><span class="line">405</span><br><span class="line">406</span><br><span class="line">407</span><br><span class="line">408</span><br><span class="line">409</span><br><span class="line">410</span><br><span class="line">411</span><br><span class="line">412</span><br><span class="line">413</span><br><span class="line">414</span><br><span class="line">415</span><br><span class="line">416</span><br><span class="line">417</span><br><span class="line">418</span><br><span class="line">419</span><br><span class="line">420</span><br><span class="line">421</span><br><span class="line">422</span><br><span class="line">423</span><br><span class="line">424</span><br><span class="line">425</span><br><span class="line">426</span><br><span class="line">427</span><br><span class="line">428</span><br><span class="line">429</span><br><span class="line">430</span><br><span class="line">431</span><br><span class="line">432</span><br><span class="line">433</span><br><span class="line">434</span><br><span class="line">435</span><br><span class="line">436</span><br><span class="line">437</span><br><span class="line">438</span><br><span class="line">439</span><br><span class="line">440</span><br><span class="line">441</span><br><span class="line">442</span><br><span class="line">443</span><br><span class="line">444</span><br><span class="line">445</span><br><span class="line">446</span><br><span class="line">447</span><br><span class="line">448</span><br><span class="line">449</span><br><span class="line">450</span><br><span class="line">451</span><br><span class="line">452</span><br><span class="line">453</span><br><span class="line">454</span><br><span class="line">455</span><br><span class="line">456</span><br><span class="line">457</span><br><span class="line">458</span><br><span class="line">459</span><br><span class="line">460</span><br><span class="line">461</span><br><span class="line">462</span><br><span class="line">463</span><br><span class="line">464</span><br><span class="line">465</span><br><span class="line">466</span><br><span class="line">467</span><br><span class="line">468</span><br><span class="line">469</span><br><span class="line">470</span><br><span class="line">471</span><br><span class="line">472</span><br><span class="line">473</span><br><span class="line">474</span><br><span class="line">475</span><br><span class="line">476</span><br><span class="line">477</span><br><span class="line">478</span><br><span class="line">479</span><br><span class="line">480</span><br><span class="line">481</span><br><span class="line">482</span><br><span class="line">483</span><br><span class="line">484</span><br><span class="line">485</span><br><span class="line">486</span><br><span class="line">487</span><br><span class="line">488</span><br><span class="line">489</span><br><span class="line">490</span><br><span class="line">491</span><br><span class="line">492</span><br><span class="line">493</span><br><span class="line">494</span><br><span class="line">495</span><br><span class="line">496</span><br><span class="line">497</span><br><span class="line">498</span><br><span class="line">499</span><br><span class="line">500</span><br><span class="line">501</span><br><span class="line">502</span><br><span class="line">503</span><br><span class="line">504</span><br><span class="line">505</span><br><span class="line">506</span><br><span class="line">507</span><br><span class="line">508</span><br><span class="line">509</span><br><span class="line">510</span><br><span class="line">511</span><br><span class="line">512</span><br><span class="line">513</span><br><span class="line">514</span><br><span class="line">515</span><br><span class="line">516</span><br><span class="line">517</span><br><span class="line">518</span><br><span class="line">519</span><br><span class="line">520</span><br><span class="line">521</span><br><span class="line">522</span><br><span class="line">523</span><br><span class="line">524</span><br><span class="line">525</span><br><span class="line">526</span><br><span class="line">527</span><br><span class="line">528</span><br><span class="line">529</span><br><span class="line">530</span><br><span class="line">531</span><br><span class="line">532</span><br><span class="line">533</span><br><span class="line">534</span><br><span class="line">535</span><br><span class="line">536</span><br><span class="line">537</span><br><span class="line">538</span><br><span class="line">539</span><br><span class="line">540</span><br><span class="line">541</span><br><span class="line">542</span><br><span class="line">543</span><br><span class="line">544</span><br><span class="line">545</span><br><span class="line">546</span><br><span class="line">547</span><br><span class="line">548</span><br><span class="line">549</span><br><span class="line">550</span><br><span class="line">551</span><br><span class="line">552</span><br><span class="line">553</span><br><span class="line">554</span><br><span class="line">555</span><br><span class="line">556</span><br><span class="line">557</span><br><span class="line">558</span><br><span class="line">559</span><br><span class="line">560</span><br><span class="line">561</span><br><span class="line">562</span><br><span class="line">563</span><br><span class="line">564</span><br><span class="line">565</span><br><span class="line">566</span><br><span class="line">567</span><br><span class="line">568</span><br><span class="line">569</span><br><span class="line">570</span><br><span class="line">571</span><br><span class="line">572</span><br><span class="line">573</span><br><span class="line">574</span><br><span class="line">575</span><br><span class="line">576</span><br><span class="line">577</span><br><span class="line">578</span><br><span class="line">579</span><br><span class="line">580</span><br><span class="line">581</span><br><span class="line">582</span><br><span class="line">583</span><br><span class="line">584</span><br><span class="line">585</span><br><span class="line">586</span><br><span class="line">587</span><br><span class="line">588</span><br><span class="line">589</span><br><span class="line">590</span><br><span class="line">591</span><br><span class="line">592</span><br><span class="line">593</span><br><span class="line">594</span><br><span class="line">595</span><br><span class="line">596</span><br><span class="line">597</span><br><span class="line">598</span><br><span class="line">599</span><br><span class="line">600</span><br><span class="line">601</span><br><span class="line">602</span><br><span class="line">603</span><br><span class="line">604</span><br><span class="line">605</span><br><span class="line">606</span><br><span class="line">607</span><br><span class="line">608</span><br><span class="line">609</span><br><span class="line">610</span><br><span class="line">611</span><br><span class="line">612</span><br><span class="line">613</span><br><span class="line">614</span><br><span class="line">615</span><br><span class="line">616</span><br><span class="line">617</span><br><span class="line">618</span><br><span class="line">619</span><br><span class="line">620</span><br><span class="line">621</span><br><span class="line">622</span><br><span class="line">623</span><br><span class="line">624</span><br><span class="line">625</span><br><span class="line">626</span><br><span class="line">627</span><br><span class="line">628</span><br><span class="line">629</span><br><span class="line">630</span><br><span class="line">631</span><br><span class="line">632</span><br><span class="line">633</span><br><span class="line">634</span><br><span class="line">635</span><br><span class="line">636</span><br><span class="line">637</span><br><span class="line">638</span><br><span class="line">639</span><br><span class="line">640</span><br><span class="line">641</span><br><span class="line">642</span><br><span class="line">643</span><br><span class="line">644</span><br><span class="line">645</span><br><span class="line">646</span><br><span class="line">647</span><br><span class="line">648</span><br><span class="line">649</span><br><span class="line">650</span><br><span class="line">651</span><br><span class="line">652</span><br><span class="line">653</span><br><span class="line">654</span><br><span class="line">655</span><br><span class="line">656</span><br><span class="line">657</span><br><span class="line">658</span><br><span class="line">659</span><br><span class="line">660</span><br><span class="line">661</span><br><span class="line">662</span><br><span class="line">663</span><br><span class="line">664</span><br><span class="line">665</span><br><span class="line">666</span><br><span class="line">667</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * struct wpa_config - wpa_supplicant configuration data</span></span><br><span class="line"><span class="comment"> *</span></span><br><span class="line"><span class="comment"> * This data structure is presents the per-interface (radio) configuration</span></span><br><span class="line"><span class="comment"> * data. In many cases, there is only one struct wpa_config instance, but if</span></span><br><span class="line"><span class="comment"> * more than one network interface is being controlled, one instance is used</span></span><br><span class="line"><span class="comment"> * for each.</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="class"><span class="keyword">struct</span> <span class="title">wpa_config</span> &#123;</span></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * ssid - Head of the global network list</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This is the head for the list of all the configured networks.</span></span><br><span class="line"><span class="comment">	 * config文件中，存储所有network节点的链表</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="class"><span class="keyword">struct</span> <span class="title">wpa_ssid</span> *<span class="title">ssid</span>;</span></span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * pssid - Per-priority network lists (in priority order)</span></span><br><span class="line"><span class="comment">	 * 按照priority排列的network节点</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="class"><span class="keyword">struct</span> <span class="title">wpa_ssid</span> **<span class="title">pssid</span>;</span></span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * num_prio - Number of different priorities used in the pssid lists</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This indicates how many per-priority network lists are included in</span></span><br><span class="line"><span class="comment">	 * pssid.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> num_prio;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * cred - Head of the credential list</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This is the head for the list of all the configured credentials.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="class"><span class="keyword">struct</span> <span class="title">wpa_cred</span> *<span class="title">cred</span>;</span></span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * eapol_version - IEEE 802.1X/EAPOL version number</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * wpa_supplicant is implemented based on IEEE Std 802.1X-2004 which</span></span><br><span class="line"><span class="comment">	 * defines EAPOL version 2. However, there are many APs that do not</span></span><br><span class="line"><span class="comment">	 * handle the new version number correctly (they seem to drop the</span></span><br><span class="line"><span class="comment">	 * frames completely). In order to make wpa_supplicant interoperate</span></span><br><span class="line"><span class="comment">	 * with these APs, the version number is set to 1 by default. This</span></span><br><span class="line"><span class="comment">	 * configuration value can be used to set it to the new version (2).</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> eapol_version;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * ap_scan - AP scanning/selection</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * By default, wpa_supplicant requests driver to perform AP</span></span><br><span class="line"><span class="comment">	 * scanning and then uses the scan results to select a</span></span><br><span class="line"><span class="comment">	 * suitable AP. Another alternative is to allow the driver to</span></span><br><span class="line"><span class="comment">	 * take care of AP scanning and selection and use</span></span><br><span class="line"><span class="comment">	 * wpa_supplicant just to process EAPOL frames based on IEEE</span></span><br><span class="line"><span class="comment">	 * 802.11 association information from the driver.</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * 1: wpa_supplicant initiates scanning and AP selection (default).</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * 0: Driver takes care of scanning, AP selection, and IEEE 802.11</span></span><br><span class="line"><span class="comment">	 * association parameters (e.g., WPA IE generation); this mode can</span></span><br><span class="line"><span class="comment">	 * also be used with non-WPA drivers when using IEEE 802.1X mode;</span></span><br><span class="line"><span class="comment">	 * do not try to associate with APs (i.e., external program needs</span></span><br><span class="line"><span class="comment">	 * to control association). This mode must also be used when using</span></span><br><span class="line"><span class="comment">	 * wired Ethernet drivers.</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * 2: like 0, but associate with APs using security policy and SSID</span></span><br><span class="line"><span class="comment">	 * (but not BSSID); this can be used, e.g., with ndiswrapper and NDIS</span></span><br><span class="line"><span class="comment">	 * drivers to enable operation with hidden SSIDs and optimized roaming;</span></span><br><span class="line"><span class="comment">	 * in this mode, the network blocks in the configuration are tried</span></span><br><span class="line"><span class="comment">	 * one by one until the driver reports successful association; each</span></span><br><span class="line"><span class="comment">	 * network block should have explicit security policy (i.e., only one</span></span><br><span class="line"><span class="comment">	 * option in the lists) for key_mgmt, pairwise, group, proto variables.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> ap_scan;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * disable_scan_offload - Disable automatic offloading of scan requests</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * By default, %wpa_supplicant tries to offload scanning if the driver</span></span><br><span class="line"><span class="comment">	 * indicates support for this (sched_scan). This configuration</span></span><br><span class="line"><span class="comment">	 * parameter can be used to disable this offloading mechanism.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> disable_scan_offload;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * ctrl_interface - Parameters for the control interface</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * If this is specified, %wpa_supplicant will open a control interface</span></span><br><span class="line"><span class="comment">	 * that is available for external programs to manage %wpa_supplicant.</span></span><br><span class="line"><span class="comment">	 * The meaning of this string depends on which control interface</span></span><br><span class="line"><span class="comment">	 * mechanism is used. For all cases, the existence of this parameter</span></span><br><span class="line"><span class="comment">	 * in configuration is used to determine whether the control interface</span></span><br><span class="line"><span class="comment">	 * is enabled.</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * For UNIX domain sockets (default on Linux and BSD): This is a</span></span><br><span class="line"><span class="comment">	 * directory that will be created for UNIX domain sockets for listening</span></span><br><span class="line"><span class="comment">	 * to requests from external programs (CLI/GUI, etc.) for status</span></span><br><span class="line"><span class="comment">	 * information and configuration. The socket file will be named based</span></span><br><span class="line"><span class="comment">	 * on the interface name, so multiple %wpa_supplicant processes can be</span></span><br><span class="line"><span class="comment">	 * run at the same time if more than one interface is used.</span></span><br><span class="line"><span class="comment">	 * /var/run/wpa_supplicant is the recommended directory for sockets and</span></span><br><span class="line"><span class="comment">	 * by default, wpa_cli will use it when trying to connect with</span></span><br><span class="line"><span class="comment">	 * %wpa_supplicant.</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * Access control for the control interface can be configured</span></span><br><span class="line"><span class="comment">	 * by setting the directory to allow only members of a group</span></span><br><span class="line"><span class="comment">	 * to use sockets. This way, it is possible to run</span></span><br><span class="line"><span class="comment">	 * %wpa_supplicant as root (since it needs to change network</span></span><br><span class="line"><span class="comment">	 * configuration and open raw sockets) and still allow GUI/CLI</span></span><br><span class="line"><span class="comment">	 * components to be run as non-root users. However, since the</span></span><br><span class="line"><span class="comment">	 * control interface can be used to change the network</span></span><br><span class="line"><span class="comment">	 * configuration, this access needs to be protected in many</span></span><br><span class="line"><span class="comment">	 * cases. By default, %wpa_supplicant is configured to use gid</span></span><br><span class="line"><span class="comment">	 * 0 (root). If you want to allow non-root users to use the</span></span><br><span class="line"><span class="comment">	 * control interface, add a new group and change this value to</span></span><br><span class="line"><span class="comment">	 * match with that group. Add users that should have control</span></span><br><span class="line"><span class="comment">	 * interface access to this group.</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * When configuring both the directory and group, use following format:</span></span><br><span class="line"><span class="comment">	 * DIR=/var/run/wpa_supplicant GROUP=wheel</span></span><br><span class="line"><span class="comment">	 * DIR=/var/run/wpa_supplicant GROUP=0</span></span><br><span class="line"><span class="comment">	 * (group can be either group name or gid)</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * For UDP connections (default on Windows): The value will be ignored.</span></span><br><span class="line"><span class="comment">	 * This variable is just used to select that the control interface is</span></span><br><span class="line"><span class="comment">	 * to be created. The value can be set to, e.g., udp</span></span><br><span class="line"><span class="comment">	 * (ctrl_interface=udp).</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * For Windows Named Pipe: This value can be used to set the security</span></span><br><span class="line"><span class="comment">	 * descriptor for controlling access to the control interface. Security</span></span><br><span class="line"><span class="comment">	 * descriptor can be set using Security Descriptor String Format (see</span></span><br><span class="line"><span class="comment">	 * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secauthz/security/security_descriptor_string_format.asp).</span></span><br><span class="line"><span class="comment">	 * The descriptor string needs to be prefixed with SDDL=. For example,</span></span><br><span class="line"><span class="comment">	 * ctrl_interface=SDDL=D: would set an empty DACL (which will reject</span></span><br><span class="line"><span class="comment">	 * all connections).</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">char</span> *ctrl_interface;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * ctrl_interface_group - Control interface group (DEPRECATED)</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This variable is only used for backwards compatibility. Group for</span></span><br><span class="line"><span class="comment">	 * UNIX domain sockets should now be specified using GROUP=group in</span></span><br><span class="line"><span class="comment">	 * ctrl_interface variable.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">char</span> *ctrl_interface_group;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * fast_reauth - EAP fast re-authentication (session resumption)</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * By default, fast re-authentication is enabled for all EAP methods</span></span><br><span class="line"><span class="comment">	 * that support it. This variable can be used to disable fast</span></span><br><span class="line"><span class="comment">	 * re-authentication (by setting fast_reauth=0). Normally, there is no</span></span><br><span class="line"><span class="comment">	 * need to disable fast re-authentication.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> fast_reauth;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * opensc_engine_path - Path to the OpenSSL engine for opensc</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This is an OpenSSL specific configuration option for loading OpenSC</span></span><br><span class="line"><span class="comment">	 * engine (engine_opensc.so); if %NULL, this engine is not loaded.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">char</span> *opensc_engine_path;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * pkcs11_engine_path - Path to the OpenSSL engine for PKCS#11</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This is an OpenSSL specific configuration option for loading PKCS#11</span></span><br><span class="line"><span class="comment">	 * engine (engine_pkcs11.so); if %NULL, this engine is not loaded.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">char</span> *pkcs11_engine_path;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * pkcs11_module_path - Path to the OpenSSL OpenSC/PKCS#11 module</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This is an OpenSSL specific configuration option for configuring</span></span><br><span class="line"><span class="comment">	 * path to OpenSC/PKCS#11 engine (opensc-pkcs11.so); if %NULL, this</span></span><br><span class="line"><span class="comment">	 * module is not loaded.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">char</span> *pkcs11_module_path;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * pcsc_reader - PC/SC reader name prefix</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * If not %NULL, PC/SC reader with a name that matches this prefix is</span></span><br><span class="line"><span class="comment">	 * initialized for SIM/USIM access. Empty string can be used to match</span></span><br><span class="line"><span class="comment">	 * the first available reader.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">char</span> *pcsc_reader;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * pcsc_pin - PIN for USIM, GSM SIM, and smartcards</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This field is used to configure PIN for SIM/USIM for EAP-SIM and</span></span><br><span class="line"><span class="comment">	 * EAP-AKA. If left out, this will be asked through control interface.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">char</span> *pcsc_pin;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * driver_param - Driver interface parameters</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This text string is passed to the selected driver interface with the</span></span><br><span class="line"><span class="comment">	 * optional struct wpa_driver_ops::set_param() handler. This can be</span></span><br><span class="line"><span class="comment">	 * used to configure driver specific options without having to add new</span></span><br><span class="line"><span class="comment">	 * driver interface functionality.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">char</span> *driver_param;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * dot11RSNAConfigPMKLifetime - Maximum lifetime of a PMK</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * dot11 MIB variable for the maximum lifetime of a PMK in the PMK</span></span><br><span class="line"><span class="comment">	 * cache (unit: seconds).</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">unsigned</span> <span class="keyword">int</span> dot11RSNAConfigPMKLifetime;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * dot11RSNAConfigPMKReauthThreshold - PMK re-authentication threshold</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * dot11 MIB variable for the percentage of the PMK lifetime</span></span><br><span class="line"><span class="comment">	 * that should expire before an IEEE 802.1X reauthentication occurs.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">unsigned</span> <span class="keyword">int</span> dot11RSNAConfigPMKReauthThreshold;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * dot11RSNAConfigSATimeout - Security association timeout</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * dot11 MIB variable for the maximum time a security association</span></span><br><span class="line"><span class="comment">	 * shall take to set up (unit: seconds).</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">unsigned</span> <span class="keyword">int</span> dot11RSNAConfigSATimeout;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * update_config - Is wpa_supplicant allowed to update configuration</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This variable control whether wpa_supplicant is allow to re-write</span></span><br><span class="line"><span class="comment">	 * its configuration with wpa_config_write(). If this is zero,</span></span><br><span class="line"><span class="comment">	 * configuration data is only changed in memory and the external data</span></span><br><span class="line"><span class="comment">	 * is not overriden. If this is non-zero, wpa_supplicant will update</span></span><br><span class="line"><span class="comment">	 * the configuration data (e.g., a file) whenever configuration is</span></span><br><span class="line"><span class="comment">	 * changed. This update may replace the old configuration which can</span></span><br><span class="line"><span class="comment">	 * remove comments from it in case of a text file configuration.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> update_config;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * blobs - Configuration blobs</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="class"><span class="keyword">struct</span> <span class="title">wpa_config_blob</span> *<span class="title">blobs</span>;</span></span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * uuid - Universally Unique IDentifier (UUID; see RFC 4122) for WPS</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	u8 uuid[<span class="number">16</span>];</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * device_name - Device Name (WPS)</span></span><br><span class="line"><span class="comment">	 * User-friendly description of device; up to 32 octets encoded in</span></span><br><span class="line"><span class="comment">	 * UTF-8</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">char</span> *device_name;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * manufacturer - Manufacturer (WPS)</span></span><br><span class="line"><span class="comment">	 * The manufacturer of the device (up to 64 ASCII characters)</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">char</span> *manufacturer;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * model_name - Model Name (WPS)</span></span><br><span class="line"><span class="comment">	 * Model of the device (up to 32 ASCII characters)</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">char</span> *model_name;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * model_number - Model Number (WPS)</span></span><br><span class="line"><span class="comment">	 * Additional device description (up to 32 ASCII characters)</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">char</span> *model_number;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * serial_number - Serial Number (WPS)</span></span><br><span class="line"><span class="comment">	 * Serial number of the device (up to 32 characters)</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">char</span> *serial_number;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * device_type - Primary Device Type (WPS)</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	u8 device_type[WPS_DEV_TYPE_LEN];</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * config_methods - Config Methods</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This is a space-separated list of supported WPS configuration</span></span><br><span class="line"><span class="comment">	 * methods. For example, "label virtual_display virtual_push_button</span></span><br><span class="line"><span class="comment">	 * keypad".</span></span><br><span class="line"><span class="comment">	 * Available methods: usba ethernet label display ext_nfc_token</span></span><br><span class="line"><span class="comment">	 * int_nfc_token nfc_interface push_button keypad</span></span><br><span class="line"><span class="comment">	 * virtual_display physical_display</span></span><br><span class="line"><span class="comment">	 * virtual_push_button physical_push_button.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">char</span> *config_methods;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * os_version - OS Version (WPS)</span></span><br><span class="line"><span class="comment">	 * 4-octet operating system version number</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	u8 os_version[<span class="number">4</span>];</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * country - Country code</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This is the ISO/IEC alpha2 country code for which we are operating</span></span><br><span class="line"><span class="comment">	 * in</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">char</span> country[<span class="number">2</span>];</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * wps_cred_processing - Credential processing</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 *   0 = process received credentials internally</span></span><br><span class="line"><span class="comment">	 *   1 = do not process received credentials; just pass them over</span></span><br><span class="line"><span class="comment">	 *	ctrl_iface to external program(s)</span></span><br><span class="line"><span class="comment">	 *   2 = process received credentials internally and pass them over</span></span><br><span class="line"><span class="comment">	 *	ctrl_iface to external program(s)</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> wps_cred_processing;</span><br><span class="line"></span><br><span class="line"><span class="meta">#<span class="meta-keyword">define</span> MAX_SEC_DEVICE_TYPES 5</span></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * sec_device_types - Secondary Device Types (P2P)</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	u8 sec_device_type[MAX_SEC_DEVICE_TYPES][WPS_DEV_TYPE_LEN];</span><br><span class="line">	<span class="keyword">int</span> num_sec_device_types;</span><br><span class="line"></span><br><span class="line">	<span class="keyword">int</span> p2p_listen_reg_class;</span><br><span class="line">	<span class="keyword">int</span> p2p_listen_channel;</span><br><span class="line">	<span class="keyword">int</span> p2p_oper_reg_class;</span><br><span class="line">	<span class="keyword">int</span> p2p_oper_channel;</span><br><span class="line">	<span class="keyword">int</span> p2p_go_intent;</span><br><span class="line">	<span class="keyword">char</span> *p2p_ssid_postfix;</span><br><span class="line">	<span class="keyword">int</span> persistent_reconnect;</span><br><span class="line">	<span class="keyword">int</span> p2p_intra_bss;</span><br><span class="line">	<span class="keyword">unsigned</span> <span class="keyword">int</span> num_p2p_pref_chan;</span><br><span class="line">	<span class="class"><span class="keyword">struct</span> <span class="title">p2p_channel</span> *<span class="title">p2p_pref_chan</span>;</span></span><br><span class="line">	<span class="keyword">int</span> p2p_ignore_shared_freq;</span><br><span class="line"></span><br><span class="line">	<span class="class"><span class="keyword">struct</span> <span class="title">wpabuf</span> *<span class="title">wps_vendor_ext_m1</span>;</span></span><br><span class="line"></span><br><span class="line"><span class="meta">#<span class="meta-keyword">define</span> MAX_WPS_VENDOR_EXT 10</span></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * wps_vendor_ext - Vendor extension attributes in WPS</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="class"><span class="keyword">struct</span> <span class="title">wpabuf</span> *<span class="title">wps_vendor_ext</span>[<span class="title">MAX_WPS_VENDOR_EXT</span>];</span></span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * p2p_group_idle - Maximum idle time in seconds for P2P group</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This value controls how long a P2P group is maintained after there</span></span><br><span class="line"><span class="comment">	 * is no other members in the group. As a GO, this means no associated</span></span><br><span class="line"><span class="comment">	 * stations in the group. As a P2P client, this means no GO seen in</span></span><br><span class="line"><span class="comment">	 * scan results. The maximum idle time is specified in seconds with 0</span></span><br><span class="line"><span class="comment">	 * indicating no time limit, i.e., the P2P group remains in active</span></span><br><span class="line"><span class="comment">	 * state indefinitely until explicitly removed. As a P2P client, the</span></span><br><span class="line"><span class="comment">	 * maximum idle time of P2P_MAX_CLIENT_IDLE seconds is enforced, i.e.,</span></span><br><span class="line"><span class="comment">	 * this parameter is mainly meant for GO use and for P2P client, it can</span></span><br><span class="line"><span class="comment">	 * only be used to reduce the default timeout to smaller value. A</span></span><br><span class="line"><span class="comment">	 * special value -1 can be used to configure immediate removal of the</span></span><br><span class="line"><span class="comment">	 * group for P2P client role on any disconnection after the data</span></span><br><span class="line"><span class="comment">	 * connection has been established.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> p2p_group_idle;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * bss_max_count - Maximum number of BSS entries to keep in memory</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">unsigned</span> <span class="keyword">int</span> bss_max_count;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * bss_expiration_age - BSS entry age after which it can be expired</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This value controls the time in seconds after which a BSS entry</span></span><br><span class="line"><span class="comment">	 * gets removed if it has not been updated or is not in use.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">unsigned</span> <span class="keyword">int</span> bss_expiration_age;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * bss_expiration_scan_count - Expire BSS after number of scans</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * If the BSS entry has not been seen in this many scans, it will be</span></span><br><span class="line"><span class="comment">	 * removed. A value of 1 means that entry is removed after the first</span></span><br><span class="line"><span class="comment">	 * scan in which the BSSID is not seen. Larger values can be used</span></span><br><span class="line"><span class="comment">	 * to avoid BSS entries disappearing if they are not visible in</span></span><br><span class="line"><span class="comment">	 * every scan (e.g., low signal quality or interference).</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">unsigned</span> <span class="keyword">int</span> bss_expiration_scan_count;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * filter_ssids - SSID-based scan result filtering</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 *   0 = do not filter scan results</span></span><br><span class="line"><span class="comment">	 *   1 = only include configured SSIDs in scan results/BSS table</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> filter_ssids;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * filter_rssi - RSSI-based scan result filtering</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * 0 = do not filter scan results</span></span><br><span class="line"><span class="comment">	 * -n = filter scan results below -n dBm</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> filter_rssi;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * max_num_sta - Maximum number of STAs in an AP/P2P GO</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">unsigned</span> <span class="keyword">int</span> max_num_sta;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * freq_list - Array of allowed scan frequencies or %NULL for all</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This is an optional zero-terminated array of frequencies in</span></span><br><span class="line"><span class="comment">	 * megahertz (MHz) to allow for narrowing scanning range.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> *freq_list;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * scan_cur_freq - Whether to scan only the current channel</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * If true, attempt to scan only the current channel if any other</span></span><br><span class="line"><span class="comment">	 * VIFs on this radio are already associated on a particular channel.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> scan_cur_freq;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * changed_parameters - Bitmap of changed parameters since last update</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">unsigned</span> <span class="keyword">int</span> changed_parameters;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * disassoc_low_ack - Disassocicate stations with massive packet loss</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> disassoc_low_ack;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * interworking - Whether Interworking (IEEE 802.11u) is enabled</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> interworking;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * access_network_type - Access Network Type</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * When Interworking is enabled, scans will be limited to APs that</span></span><br><span class="line"><span class="comment">	 * advertise the specified Access Network Type (0..15; with 15</span></span><br><span class="line"><span class="comment">	 * indicating wildcard match).</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> access_network_type;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * hessid - Homogenous ESS identifier</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * If this is set (any octet is non-zero), scans will be used to</span></span><br><span class="line"><span class="comment">	 * request response only from BSSes belonging to the specified</span></span><br><span class="line"><span class="comment">	 * Homogeneous ESS. This is used only if interworking is enabled.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	u8 hessid[ETH_ALEN];</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * hs20 - Hotspot 2.0</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> hs20;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * pbc_in_m1 - AP mode WPS probing workaround for PBC with Windows 7</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * Windows 7 uses incorrect way of figuring out AP's WPS capabilities</span></span><br><span class="line"><span class="comment">	 * by acting as a Registrar and using M1 from the AP. The config</span></span><br><span class="line"><span class="comment">	 * methods attribute in that message is supposed to indicate only the</span></span><br><span class="line"><span class="comment">	 * configuration method supported by the AP in Enrollee role, i.e., to</span></span><br><span class="line"><span class="comment">	 * add an external Registrar. For that case, PBC shall not be used and</span></span><br><span class="line"><span class="comment">	 * as such, the PushButton config method is removed from M1 by default.</span></span><br><span class="line"><span class="comment">	 * If pbc_in_m1=1 is included in the configuration file, the PushButton</span></span><br><span class="line"><span class="comment">	 * config method is left in M1 (if included in config_methods</span></span><br><span class="line"><span class="comment">	 * parameter) to allow Windows 7 to use PBC instead of PIN (e.g., from</span></span><br><span class="line"><span class="comment">	 * a label in the AP).</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> pbc_in_m1;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * autoscan - Automatic scan parameters or %NULL if none</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This is an optional set of parameters for automatic scanning</span></span><br><span class="line"><span class="comment">	 * within an interface in following format:</span></span><br><span class="line"><span class="comment">	 * &lt;autoscan module name&gt;:&lt;module parameters&gt;</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">char</span> *autoscan;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * wps_nfc_pw_from_config - NFC Device Password was read from config</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This parameter can be determined whether the NFC Device Password was</span></span><br><span class="line"><span class="comment">	 * included in the configuration (1) or generated dynamically (0). Only</span></span><br><span class="line"><span class="comment">	 * the former case is re-written back to the configuration file.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> wps_nfc_pw_from_config;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * wps_nfc_dev_pw_id - NFC Device Password ID for password token</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> wps_nfc_dev_pw_id;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * wps_nfc_dh_pubkey - NFC DH Public Key for password token</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="class"><span class="keyword">struct</span> <span class="title">wpabuf</span> *<span class="title">wps_nfc_dh_pubkey</span>;</span></span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * wps_nfc_dh_privkey - NFC DH Private Key for password token</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="class"><span class="keyword">struct</span> <span class="title">wpabuf</span> *<span class="title">wps_nfc_dh_privkey</span>;</span></span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * wps_nfc_dev_pw - NFC Device Password for password token</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="class"><span class="keyword">struct</span> <span class="title">wpabuf</span> *<span class="title">wps_nfc_dev_pw</span>;</span></span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * ext_password_backend - External password backend or %NULL if none</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * format: &lt;backend name&gt;[:&lt;optional backend parameters&gt;]</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">char</span> *ext_password_backend;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/*</span></span><br><span class="line"><span class="comment">	 * p2p_go_max_inactivity - Timeout in seconds to detect STA inactivity</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This timeout value is used in P2P GO mode to clean up</span></span><br><span class="line"><span class="comment">	 * inactive stations.</span></span><br><span class="line"><span class="comment">	 * By default: 300 seconds.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> p2p_go_max_inactivity;</span><br><span class="line"></span><br><span class="line">	<span class="class"><span class="keyword">struct</span> <span class="title">hostapd_wmm_ac_params</span> <span class="title">wmm_ac_params</span>[4];</span></span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * auto_interworking - Whether to use network selection automatically</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * 0 = do not automatically go through Interworking network selection</span></span><br><span class="line"><span class="comment">	 *     (i.e., require explicit interworking_select command for this)</span></span><br><span class="line"><span class="comment">	 * 1 = perform Interworking network selection if one or more</span></span><br><span class="line"><span class="comment">	 *     credentials have been configured and scan did not find a</span></span><br><span class="line"><span class="comment">	 *     matching network block</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> auto_interworking;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * p2p_go_ht40 - Default mode for HT40 enable when operating as GO.</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This will take effect for p2p_group_add, p2p_connect, and p2p_invite.</span></span><br><span class="line"><span class="comment">	 * Note that regulatory constraints and driver capabilities are</span></span><br><span class="line"><span class="comment">	 * consulted anyway, so setting it to 1 can't do real harm.</span></span><br><span class="line"><span class="comment">	 * By default: 0 (disabled)</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> p2p_go_ht40;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * p2p_disabled - Whether P2P operations are disabled for this interface</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> p2p_disabled;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * p2p_no_group_iface - Whether group interfaces can be used</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * By default, wpa_supplicant will create a separate interface for P2P</span></span><br><span class="line"><span class="comment">	 * group operations if the driver supports this. This functionality can</span></span><br><span class="line"><span class="comment">	 * be disabled by setting this parameter to 1. In that case, the same</span></span><br><span class="line"><span class="comment">	 * interface that was used for the P2P management operations is used</span></span><br><span class="line"><span class="comment">	 * also for the group operation.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> p2p_no_group_iface;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * okc - Whether to enable opportunistic key caching by default</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * By default, OKC is disabled unless enabled by the per-network</span></span><br><span class="line"><span class="comment">	 * proactive_key_caching=1 parameter. okc=1 can be used to change this</span></span><br><span class="line"><span class="comment">	 * default behavior.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> okc;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * pmf - Whether to enable/require PMF by default</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * By default, PMF is disabled unless enabled by the per-network</span></span><br><span class="line"><span class="comment">	 * ieee80211w=1 or ieee80211w=2 parameter. pmf=1/2 can be used to change</span></span><br><span class="line"><span class="comment">	 * this default behavior.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">enum</span> mfp_options pmf;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * sae_groups - Preference list of enabled groups for SAE</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * By default (if this parameter is not set), the mandatory group 19</span></span><br><span class="line"><span class="comment">	 * (ECC group defined over a 256-bit prime order field) is preferred,</span></span><br><span class="line"><span class="comment">	 * but other groups are also enabled. If this parameter is set, the</span></span><br><span class="line"><span class="comment">	 * groups will be tried in the indicated order.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> *sae_groups;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * dtim_period - Default DTIM period in Beacon intervals</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This parameter can be used to set the default value for network</span></span><br><span class="line"><span class="comment">	 * blocks that do not specify dtim_period.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> dtim_period;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * beacon_int - Default Beacon interval in TU</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This parameter can be used to set the default value for network</span></span><br><span class="line"><span class="comment">	 * blocks that do not specify beacon_int.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> beacon_int;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * ap_vendor_elements: Vendor specific elements for Beacon/ProbeResp</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This parameter can be used to define additional vendor specific</span></span><br><span class="line"><span class="comment">	 * elements for Beacon and Probe Response frames in AP/P2P GO mode. The</span></span><br><span class="line"><span class="comment">	 * format for these element(s) is a hexdump of the raw information</span></span><br><span class="line"><span class="comment">	 * elements (id+len+payload for one or more elements).</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="class"><span class="keyword">struct</span> <span class="title">wpabuf</span> *<span class="title">ap_vendor_elements</span>;</span></span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * ignore_old_scan_res - Ignore scan results older than request</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * The driver may have a cache of scan results that makes it return</span></span><br><span class="line"><span class="comment">	 * information that is older than our scan trigger. This parameter can</span></span><br><span class="line"><span class="comment">	 * be used to configure such old information to be ignored instead of</span></span><br><span class="line"><span class="comment">	 * allowing it to update the internal BSS table.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> ignore_old_scan_res;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * sched_scan_interval -  schedule scan interval</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">unsigned</span> <span class="keyword">int</span> sched_scan_interval;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * tdls_external_control - External control for TDLS setup requests</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * Enable TDLS mode where external programs are given the control</span></span><br><span class="line"><span class="comment">	 * to specify the TDLS link to get established to the driver. The</span></span><br><span class="line"><span class="comment">	 * driver requests the TDLS setup to the supplicant only for the</span></span><br><span class="line"><span class="comment">	 * specified TDLS peers.</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> tdls_external_control;</span><br><span class="line">&#125;;</span><br></pre></td></tr></table></figure><h3 id="network节点"><a href="#network节点" class="headerlink" title="network节点"></a>network节点</h3><p>wpa_supplicant.conf文件中每个network节点都是一个保存的网络, 存储了网络的名称（ssid），密码（psk），加密方式（WPA_PSK），优先级（priority）</p><p>WIFI网络有多种加密方式，每种加密方式（wpa_psk，wep，open，wapi，各种eap等）的节点书写方式都不同，具体可以参考源代码中<a href="http://w1.fi/cgit/hostap/plain/wpa_supplicant/wpa_supplicant.conf" target="_blank" rel="noopener">wpa_supplicant.conf</a>文件</p><p>network节点的结构体<code>struct wpa_ssid</code></p><figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br><span class="line">201</span><br><span class="line">202</span><br><span class="line">203</span><br><span class="line">204</span><br><span class="line">205</span><br><span class="line">206</span><br><span class="line">207</span><br><span class="line">208</span><br><span class="line">209</span><br><span class="line">210</span><br><span class="line">211</span><br><span class="line">212</span><br><span class="line">213</span><br><span class="line">214</span><br><span class="line">215</span><br><span class="line">216</span><br><span class="line">217</span><br><span class="line">218</span><br><span class="line">219</span><br><span class="line">220</span><br><span class="line">221</span><br><span class="line">222</span><br><span class="line">223</span><br><span class="line">224</span><br><span class="line">225</span><br><span class="line">226</span><br><span class="line">227</span><br><span class="line">228</span><br><span class="line">229</span><br><span class="line">230</span><br><span class="line">231</span><br><span class="line">232</span><br><span class="line">233</span><br><span class="line">234</span><br><span class="line">235</span><br><span class="line">236</span><br><span class="line">237</span><br><span class="line">238</span><br><span class="line">239</span><br><span class="line">240</span><br><span class="line">241</span><br><span class="line">242</span><br><span class="line">243</span><br><span class="line">244</span><br><span class="line">245</span><br><span class="line">246</span><br><span class="line">247</span><br><span class="line">248</span><br><span class="line">249</span><br><span class="line">250</span><br><span class="line">251</span><br><span class="line">252</span><br><span class="line">253</span><br><span class="line">254</span><br><span class="line">255</span><br><span class="line">256</span><br><span class="line">257</span><br><span class="line">258</span><br><span class="line">259</span><br><span class="line">260</span><br><span class="line">261</span><br><span class="line">262</span><br><span class="line">263</span><br><span class="line">264</span><br><span class="line">265</span><br><span class="line">266</span><br><span class="line">267</span><br><span class="line">268</span><br><span class="line">269</span><br><span class="line">270</span><br><span class="line">271</span><br><span class="line">272</span><br><span class="line">273</span><br><span class="line">274</span><br><span class="line">275</span><br><span class="line">276</span><br><span class="line">277</span><br><span class="line">278</span><br><span class="line">279</span><br><span class="line">280</span><br><span class="line">281</span><br><span class="line">282</span><br><span class="line">283</span><br><span class="line">284</span><br><span class="line">285</span><br><span class="line">286</span><br><span class="line">287</span><br><span class="line">288</span><br><span class="line">289</span><br><span class="line">290</span><br><span class="line">291</span><br><span class="line">292</span><br><span class="line">293</span><br><span class="line">294</span><br><span class="line">295</span><br><span class="line">296</span><br><span class="line">297</span><br><span class="line">298</span><br><span class="line">299</span><br><span class="line">300</span><br><span class="line">301</span><br><span class="line">302</span><br><span class="line">303</span><br><span class="line">304</span><br><span class="line">305</span><br><span class="line">306</span><br><span class="line">307</span><br><span class="line">308</span><br><span class="line">309</span><br><span class="line">310</span><br><span class="line">311</span><br><span class="line">312</span><br><span class="line">313</span><br><span class="line">314</span><br><span class="line">315</span><br><span class="line">316</span><br><span class="line">317</span><br><span class="line">318</span><br><span class="line">319</span><br><span class="line">320</span><br><span class="line">321</span><br><span class="line">322</span><br><span class="line">323</span><br><span class="line">324</span><br><span class="line">325</span><br><span class="line">326</span><br><span class="line">327</span><br><span class="line">328</span><br><span class="line">329</span><br><span class="line">330</span><br><span class="line">331</span><br><span class="line">332</span><br><span class="line">333</span><br><span class="line">334</span><br><span class="line">335</span><br><span class="line">336</span><br><span class="line">337</span><br><span class="line">338</span><br><span class="line">339</span><br><span class="line">340</span><br><span class="line">341</span><br><span class="line">342</span><br><span class="line">343</span><br><span class="line">344</span><br><span class="line">345</span><br><span class="line">346</span><br><span class="line">347</span><br><span class="line">348</span><br><span class="line">349</span><br><span class="line">350</span><br><span class="line">351</span><br><span class="line">352</span><br><span class="line">353</span><br><span class="line">354</span><br><span class="line">355</span><br><span class="line">356</span><br><span class="line">357</span><br><span class="line">358</span><br><span class="line">359</span><br><span class="line">360</span><br><span class="line">361</span><br><span class="line">362</span><br><span class="line">363</span><br><span class="line">364</span><br><span class="line">365</span><br><span class="line">366</span><br><span class="line">367</span><br><span class="line">368</span><br><span class="line">369</span><br><span class="line">370</span><br><span class="line">371</span><br><span class="line">372</span><br><span class="line">373</span><br><span class="line">374</span><br><span class="line">375</span><br><span class="line">376</span><br><span class="line">377</span><br><span class="line">378</span><br><span class="line">379</span><br><span class="line">380</span><br><span class="line">381</span><br><span class="line">382</span><br><span class="line">383</span><br><span class="line">384</span><br><span class="line">385</span><br><span class="line">386</span><br><span class="line">387</span><br><span class="line">388</span><br><span class="line">389</span><br><span class="line">390</span><br><span class="line">391</span><br><span class="line">392</span><br><span class="line">393</span><br><span class="line">394</span><br><span class="line">395</span><br><span class="line">396</span><br><span class="line">397</span><br><span class="line">398</span><br><span class="line">399</span><br><span class="line">400</span><br><span class="line">401</span><br><span class="line">402</span><br><span class="line">403</span><br><span class="line">404</span><br><span class="line">405</span><br><span class="line">406</span><br><span class="line">407</span><br><span class="line">408</span><br><span class="line">409</span><br><span class="line">410</span><br><span class="line">411</span><br><span class="line">412</span><br><span class="line">413</span><br><span class="line">414</span><br><span class="line">415</span><br><span class="line">416</span><br><span class="line">417</span><br><span class="line">418</span><br><span class="line">419</span><br><span class="line">420</span><br><span class="line">421</span><br><span class="line">422</span><br><span class="line">423</span><br><span class="line">424</span><br><span class="line">425</span><br><span class="line">426</span><br><span class="line">427</span><br><span class="line">428</span><br><span class="line">429</span><br><span class="line">430</span><br><span class="line">431</span><br><span class="line">432</span><br><span class="line">433</span><br><span class="line">434</span><br><span class="line">435</span><br><span class="line">436</span><br><span class="line">437</span><br><span class="line">438</span><br><span class="line">439</span><br><span class="line">440</span><br><span class="line">441</span><br><span class="line">442</span><br><span class="line">443</span><br><span class="line">444</span><br><span class="line">445</span><br><span class="line">446</span><br><span class="line">447</span><br><span class="line">448</span><br><span class="line">449</span><br><span class="line">450</span><br><span class="line">451</span><br><span class="line">452</span><br><span class="line">453</span><br><span class="line">454</span><br><span class="line">455</span><br><span class="line">456</span><br><span class="line">457</span><br><span class="line">458</span><br><span class="line">459</span><br><span class="line">460</span><br><span class="line">461</span><br><span class="line">462</span><br><span class="line">463</span><br><span class="line">464</span><br><span class="line">465</span><br><span class="line">466</span><br><span class="line">467</span><br><span class="line">468</span><br><span class="line">469</span><br><span class="line">470</span><br><span class="line">471</span><br><span class="line">472</span><br><span class="line">473</span><br><span class="line">474</span><br><span class="line">475</span><br><span class="line">476</span><br><span class="line">477</span><br><span class="line">478</span><br><span class="line">479</span><br><span class="line">480</span><br><span class="line">481</span><br><span class="line">482</span><br><span class="line">483</span><br><span class="line">484</span><br><span class="line">485</span><br><span class="line">486</span><br><span class="line">487</span><br><span class="line">488</span><br><span class="line">489</span><br><span class="line">490</span><br><span class="line">491</span><br><span class="line">492</span><br><span class="line">493</span><br><span class="line">494</span><br><span class="line">495</span><br><span class="line">496</span><br><span class="line">497</span><br><span class="line">498</span><br><span class="line">499</span><br><span class="line">500</span><br><span class="line">501</span><br><span class="line">502</span><br><span class="line">503</span><br><span class="line">504</span><br><span class="line">505</span><br><span class="line">506</span><br><span class="line">507</span><br><span class="line">508</span><br><span class="line">509</span><br><span class="line">510</span><br><span class="line">511</span><br><span class="line">512</span><br><span class="line">513</span><br><span class="line">514</span><br><span class="line">515</span><br><span class="line">516</span><br><span class="line">517</span><br><span class="line">518</span><br><span class="line">519</span><br><span class="line">520</span><br><span class="line">521</span><br><span class="line">522</span><br><span class="line">523</span><br><span class="line">524</span><br><span class="line">525</span><br><span class="line">526</span><br><span class="line">527</span><br><span class="line">528</span><br><span class="line">529</span><br><span class="line">530</span><br><span class="line">531</span><br><span class="line">532</span><br><span class="line">533</span><br><span class="line">534</span><br><span class="line">535</span><br><span class="line">536</span><br><span class="line">537</span><br><span class="line">538</span><br><span class="line">539</span><br><span class="line">540</span><br><span class="line">541</span><br><span class="line">542</span><br><span class="line">543</span><br><span class="line">544</span><br><span class="line">545</span><br><span class="line">546</span><br><span class="line">547</span><br><span class="line">548</span><br><span class="line">549</span><br><span class="line">550</span><br><span class="line">551</span><br><span class="line">552</span><br><span class="line">553</span><br><span class="line">554</span><br><span class="line">555</span><br><span class="line">556</span><br><span class="line">557</span><br><span class="line">558</span><br><span class="line">559</span><br><span class="line">560</span><br><span class="line">561</span><br><span class="line">562</span><br><span class="line">563</span><br><span class="line">564</span><br><span class="line">565</span><br><span class="line">566</span><br><span class="line">567</span><br><span class="line">568</span><br><span class="line">569</span><br><span class="line">570</span><br><span class="line">571</span><br><span class="line">572</span><br><span class="line">573</span><br><span class="line">574</span><br><span class="line">575</span><br><span class="line">576</span><br><span class="line">577</span><br><span class="line">578</span><br><span class="line">579</span><br><span class="line">580</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * struct wpa_ssid - Network configuration data</span></span><br><span class="line"><span class="comment"> *</span></span><br><span class="line"><span class="comment"> * This structure includes all the configuration variables for a network. This</span></span><br><span class="line"><span class="comment"> * data is included in the per-interface configuration data as an element of</span></span><br><span class="line"><span class="comment"> * the network list, struct wpa_config::ssid. Each network block in the</span></span><br><span class="line"><span class="comment"> * configuration is mapped to a struct wpa_ssid instance.</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="class"><span class="keyword">struct</span> <span class="title">wpa_ssid</span> &#123;</span></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * next - Next network in global list</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This pointer can be used to iterate over all networks. The head of</span></span><br><span class="line"><span class="comment">	 * this list is stored in the ssid field of struct wpa_config.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="class"><span class="keyword">struct</span> <span class="title">wpa_ssid</span> *<span class="title">next</span>;</span></span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * pnext - Next network in per-priority list</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This pointer can be used to iterate over all networks in the same</span></span><br><span class="line"><span class="comment">	 * priority class. The heads of these list are stored in the pssid</span></span><br><span class="line"><span class="comment">	 * fields of struct wpa_config.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="class"><span class="keyword">struct</span> <span class="title">wpa_ssid</span> *<span class="title">pnext</span>;</span></span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * id - Unique id for the network</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This identifier is used as a unique identifier for each network</span></span><br><span class="line"><span class="comment">	 * block when using the control interface. Each network is allocated an</span></span><br><span class="line"><span class="comment">	 * id when it is being created, either when reading the configuration</span></span><br><span class="line"><span class="comment">	 * file or when a new network is added through the control interface.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> id;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * priority - Priority group</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * By default, all networks will get same priority group (0). If some</span></span><br><span class="line"><span class="comment">	 * of the networks are more desirable, this field can be used to change</span></span><br><span class="line"><span class="comment">	 * the order in which wpa_supplicant goes through the networks when</span></span><br><span class="line"><span class="comment">	 * selecting a BSS. The priority groups will be iterated in decreasing</span></span><br><span class="line"><span class="comment">	 * priority (i.e., the larger the priority value, the sooner the</span></span><br><span class="line"><span class="comment">	 * network is matched against the scan results). Within each priority</span></span><br><span class="line"><span class="comment">	 * group, networks will be selected based on security policy, signal</span></span><br><span class="line"><span class="comment">	 * strength, etc.</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * Please note that AP scanning with scan_ssid=1 and ap_scan=2 mode are</span></span><br><span class="line"><span class="comment">	 * not using this priority to select the order for scanning. Instead,</span></span><br><span class="line"><span class="comment">	 * they try the networks in the order that used in the configuration</span></span><br><span class="line"><span class="comment">	 * file.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> priority;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * ssid - Service set identifier (network name)</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This is the SSID for the network. For wireless interfaces, this is</span></span><br><span class="line"><span class="comment">	 * used to select which network will be used. If set to %NULL (or</span></span><br><span class="line"><span class="comment">	 * ssid_len=0), any SSID can be used. For wired interfaces, this must</span></span><br><span class="line"><span class="comment">	 * be set to %NULL. Note: SSID may contain any characters, even nul</span></span><br><span class="line"><span class="comment">	 * (ASCII 0) and as such, this should not be assumed to be a nul</span></span><br><span class="line"><span class="comment">	 * terminated string. ssid_len defines how many characters are valid</span></span><br><span class="line"><span class="comment">	 * and the ssid field is not guaranteed to be nul terminated.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	u8 *ssid;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * ssid_len - Length of the SSID</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">size_t</span> ssid_len;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * bssid - BSSID</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * If set, this network block is used only when associating with the AP</span></span><br><span class="line"><span class="comment">	 * using the configured BSSID</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * If this is a persistent P2P group (disabled == 2), this is the GO</span></span><br><span class="line"><span class="comment">	 * Device Address.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	u8 bssid[ETH_ALEN];</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * bssid_set - Whether BSSID is configured for this network</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> bssid_set;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * psk - WPA pre-shared key (256 bits)</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	u8 psk[<span class="number">32</span>];</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * psk_set - Whether PSK field is configured</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> psk_set;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * passphrase - WPA ASCII passphrase</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * If this is set, psk will be generated using the SSID and passphrase</span></span><br><span class="line"><span class="comment">	 * configured for the network. ASCII passphrase must be between 8 and</span></span><br><span class="line"><span class="comment">	 * 63 characters (inclusive).</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">char</span> *passphrase;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * ext_psk - PSK/passphrase name in external storage</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * If this is set, PSK/passphrase will be fetched from external storage</span></span><br><span class="line"><span class="comment">	 * when requesting association with the network.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">char</span> *ext_psk;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * pairwise_cipher - Bitfield of allowed pairwise ciphers, WPA_CIPHER_*</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> pairwise_cipher;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * group_cipher - Bitfield of allowed group ciphers, WPA_CIPHER_*</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> group_cipher;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * key_mgmt - Bitfield of allowed key management protocols</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * WPA_KEY_MGMT_*</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> key_mgmt;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * bg_scan_period - Background scan period in seconds, 0 to disable, or</span></span><br><span class="line"><span class="comment">	 * -1 to indicate no change to default driver configuration</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> bg_scan_period;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * proto - Bitfield of allowed protocols, WPA_PROTO_*</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> proto;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * auth_alg -  Bitfield of allowed authentication algorithms</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * WPA_AUTH_ALG_*</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> auth_alg;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * scan_ssid - Scan this SSID with Probe Requests</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * scan_ssid can be used to scan for APs using hidden SSIDs.</span></span><br><span class="line"><span class="comment">	 * Note: Many drivers do not support this. ap_mode=2 can be used with</span></span><br><span class="line"><span class="comment">	 * such drivers to use hidden SSIDs.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> scan_ssid;</span><br><span class="line"></span><br><span class="line"><span class="meta">#<span class="meta-keyword">ifdef</span> IEEE8021X_EAPOL</span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">define</span> EAPOL_FLAG_REQUIRE_KEY_UNICAST BIT(0)</span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">define</span> EAPOL_FLAG_REQUIRE_KEY_BROADCAST BIT(1)</span></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * eapol_flags - Bit field of IEEE 802.1X/EAPOL options (EAPOL_FLAG_*)</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> eapol_flags;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * eap - EAP peer configuration for this network</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="class"><span class="keyword">struct</span> <span class="title">eap_peer_config</span> <span class="title">eap</span>;</span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">endif</span> <span class="comment">/* IEEE8021X_EAPOL */</span></span></span><br><span class="line"></span><br><span class="line"><span class="meta">#<span class="meta-keyword">define</span> NUM_WEP_KEYS 4</span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">define</span> MAX_WEP_KEY_LEN 16</span></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * wep_key - WEP keys</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	u8 wep_key[NUM_WEP_KEYS][MAX_WEP_KEY_LEN];</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * wep_key_len - WEP key lengths</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">size_t</span> wep_key_len[NUM_WEP_KEYS];</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * wep_tx_keyidx - Default key index for TX frames using WEP</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> wep_tx_keyidx;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * proactive_key_caching - Enable proactive key caching</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This field can be used to enable proactive key caching which is also</span></span><br><span class="line"><span class="comment">	 * known as opportunistic PMKSA caching for WPA2. This is disabled (0)</span></span><br><span class="line"><span class="comment">	 * by default unless default value is changed with the global okc=1</span></span><br><span class="line"><span class="comment">	 * parameter. Enable by setting this to 1.</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * Proactive key caching is used to make supplicant assume that the APs</span></span><br><span class="line"><span class="comment">	 * are using the same PMK and generate PMKSA cache entries without</span></span><br><span class="line"><span class="comment">	 * doing RSN pre-authentication. This requires support from the AP side</span></span><br><span class="line"><span class="comment">	 * and is normally used with wireless switches that co-locate the</span></span><br><span class="line"><span class="comment">	 * authenticator.</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * Internally, special value -1 is used to indicate that the parameter</span></span><br><span class="line"><span class="comment">	 * was not specified in the configuration (i.e., default behavior is</span></span><br><span class="line"><span class="comment">	 * followed).</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> proactive_key_caching;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * mixed_cell - Whether mixed cells are allowed</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This option can be used to configure whether so called mixed cells,</span></span><br><span class="line"><span class="comment">	 * i.e., networks that use both plaintext and encryption in the same</span></span><br><span class="line"><span class="comment">	 * SSID, are allowed. This is disabled (0) by default. Enable by</span></span><br><span class="line"><span class="comment">	 * setting this to 1.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> mixed_cell;</span><br><span class="line"></span><br><span class="line"><span class="meta">#<span class="meta-keyword">ifdef</span> IEEE8021X_EAPOL</span></span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * leap - Number of EAP methods using LEAP</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This field should be set to 1 if LEAP is enabled. This is used to</span></span><br><span class="line"><span class="comment">	 * select IEEE 802.11 authentication algorithm.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> leap;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * non_leap - Number of EAP methods not using LEAP</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This field should be set to &gt;0 if any EAP method other than LEAP is</span></span><br><span class="line"><span class="comment">	 * enabled. This is used to select IEEE 802.11 authentication</span></span><br><span class="line"><span class="comment">	 * algorithm.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> non_leap;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * eap_workaround - EAP workarounds enabled</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * wpa_supplicant supports number of "EAP workarounds" to work around</span></span><br><span class="line"><span class="comment">	 * interoperability issues with incorrectly behaving authentication</span></span><br><span class="line"><span class="comment">	 * servers. This is recommended to be enabled by default because some</span></span><br><span class="line"><span class="comment">	 * of the issues are present in large number of authentication servers.</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * Strict EAP conformance mode can be configured by disabling</span></span><br><span class="line"><span class="comment">	 * workarounds with eap_workaround = 0.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">unsigned</span> <span class="keyword">int</span> eap_workaround;</span><br><span class="line"></span><br><span class="line"><span class="meta">#<span class="meta-keyword">endif</span> <span class="comment">/* IEEE8021X_EAPOL */</span></span></span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * mode - IEEE 802.11 operation mode (Infrastucture/IBSS)</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * 0 = infrastructure (Managed) mode, i.e., associate with an AP.</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * 1 = IBSS (ad-hoc, peer-to-peer)</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * 2 = AP (access point)</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * 3 = P2P Group Owner (can be set in the configuration file)</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * 4 = P2P Group Formation (used internally; not in configuration</span></span><br><span class="line"><span class="comment">	 * files)</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * Note: IBSS can only be used with key_mgmt NONE (plaintext and</span></span><br><span class="line"><span class="comment">	 * static WEP) and key_mgmt=WPA-NONE (fixed group key TKIP/CCMP). In</span></span><br><span class="line"><span class="comment">	 * addition, ap_scan has to be set to 2 for IBSS. WPA-None requires</span></span><br><span class="line"><span class="comment">	 * following network block options: proto=WPA, key_mgmt=WPA-NONE,</span></span><br><span class="line"><span class="comment">	 * pairwise=NONE, group=TKIP (or CCMP, but not both), and psk must also</span></span><br><span class="line"><span class="comment">	 * be set (either directly or using ASCII passphrase).</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">enum</span> wpas_mode &#123;</span><br><span class="line">		WPAS_MODE_INFRA = <span class="number">0</span>,</span><br><span class="line">		WPAS_MODE_IBSS = <span class="number">1</span>,</span><br><span class="line">		WPAS_MODE_AP = <span class="number">2</span>,</span><br><span class="line">		WPAS_MODE_P2P_GO = <span class="number">3</span>,</span><br><span class="line">		WPAS_MODE_P2P_GROUP_FORMATION = <span class="number">4</span>,</span><br><span class="line">	&#125; mode;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * disabled - Whether this network is currently disabled</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * 0 = this network can be used (default).</span></span><br><span class="line"><span class="comment">	 * 1 = this network block is disabled (can be enabled through</span></span><br><span class="line"><span class="comment">	 * ctrl_iface, e.g., with wpa_cli or wpa_gui).</span></span><br><span class="line"><span class="comment">	 * 2 = this network block includes parameters for a persistent P2P</span></span><br><span class="line"><span class="comment">	 * group (can be used with P2P ctrl_iface commands)</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> disabled;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * disabled_for_connect - Whether this network was temporarily disabled</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This flag is used to reenable all the temporarily disabled networks</span></span><br><span class="line"><span class="comment">	 * after either the success or failure of a WPS connection.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> disabled_for_connect;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * peerkey -  Whether PeerKey handshake for direct links is allowed</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This is only used when both RSN/WPA2 and IEEE 802.11e (QoS) are</span></span><br><span class="line"><span class="comment">	 * enabled.</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * 0 = disabled (default)</span></span><br><span class="line"><span class="comment">	 * 1 = enabled</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> peerkey;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * id_str - Network identifier string for external scripts</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This value is passed to external ctrl_iface monitors in</span></span><br><span class="line"><span class="comment">	 * WPA_EVENT_CONNECTED event and wpa_cli sets this as WPA_ID_STR</span></span><br><span class="line"><span class="comment">	 * environment variable for action scripts.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">char</span> *id_str;</span><br><span class="line"></span><br><span class="line"><span class="meta">#<span class="meta-keyword">ifdef</span> CONFIG_IEEE80211W</span></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * ieee80211w - Whether management frame protection is enabled</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This value is used to configure policy for management frame</span></span><br><span class="line"><span class="comment">	 * protection (IEEE 802.11w). 0 = disabled, 1 = optional, 2 = required.</span></span><br><span class="line"><span class="comment">	 * This is disabled by default unless the default value has been changed</span></span><br><span class="line"><span class="comment">	 * with the global pmf=1/2 parameter.</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * Internally, special value 3 is used to indicate that the parameter</span></span><br><span class="line"><span class="comment">	 * was not specified in the configuration (i.e., default behavior is</span></span><br><span class="line"><span class="comment">	 * followed).</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">enum</span> mfp_options ieee80211w;</span><br><span class="line"><span class="meta">#<span class="meta-keyword">endif</span> <span class="comment">/* CONFIG_IEEE80211W */</span></span></span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * frequency - Channel frequency in megahertz (MHz) for IBSS</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This value is used to configure the initial channel for IBSS (adhoc)</span></span><br><span class="line"><span class="comment">	 * networks, e.g., 2412 = IEEE 802.11b/g channel 1. It is ignored in</span></span><br><span class="line"><span class="comment">	 * the infrastructure mode. In addition, this value is only used by the</span></span><br><span class="line"><span class="comment">	 * station that creates the IBSS. If an IBSS network with the</span></span><br><span class="line"><span class="comment">	 * configured SSID is already present, the frequency of the network</span></span><br><span class="line"><span class="comment">	 * will be used instead of this configured value.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> frequency;</span><br><span class="line"></span><br><span class="line">	<span class="keyword">int</span> ht40;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * wpa_ptk_rekey - Maximum lifetime for PTK in seconds</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This value can be used to enforce rekeying of PTK to mitigate some</span></span><br><span class="line"><span class="comment">	 * attacks against TKIP deficiencies.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> wpa_ptk_rekey;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * scan_freq - Array of frequencies to scan or %NULL for all</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This is an optional zero-terminated array of frequencies in</span></span><br><span class="line"><span class="comment">	 * megahertz (MHz) to include in scan requests when searching for this</span></span><br><span class="line"><span class="comment">	 * network. This can be used to speed up scanning when the network is</span></span><br><span class="line"><span class="comment">	 * known to not use all possible channels.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> *scan_freq;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * bgscan - Background scan and roaming parameters or %NULL if none</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This is an optional set of parameters for background scanning and</span></span><br><span class="line"><span class="comment">	 * roaming within a network (ESS) in following format:</span></span><br><span class="line"><span class="comment">	 * &lt;bgscan module name&gt;:&lt;module parameters&gt;</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">char</span> *bgscan;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * ignore_broadcast_ssid - Hide SSID in AP mode</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * Send empty SSID in beacons and ignore probe request frames that do</span></span><br><span class="line"><span class="comment">	 * not specify full SSID, i.e., require stations to know SSID.</span></span><br><span class="line"><span class="comment">	 * default: disabled (0)</span></span><br><span class="line"><span class="comment">	 * 1 = send empty (length=0) SSID in beacon and ignore probe request</span></span><br><span class="line"><span class="comment">	 * for broadcast SSID</span></span><br><span class="line"><span class="comment">	 * 2 = clear SSID (ASCII 0), but keep the original length (this may be</span></span><br><span class="line"><span class="comment">	 * required with some clients that do not support empty SSID) and</span></span><br><span class="line"><span class="comment">	 * ignore probe requests for broadcast SSID</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> ignore_broadcast_ssid;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * freq_list - Array of allowed frequencies or %NULL for all</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This is an optional zero-terminated array of frequencies in</span></span><br><span class="line"><span class="comment">	 * megahertz (MHz) to allow for selecting the BSS. If set, scan results</span></span><br><span class="line"><span class="comment">	 * that do not match any of the specified frequencies are not</span></span><br><span class="line"><span class="comment">	 * considered when selecting a BSS.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> *freq_list;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * p2p_client_list - List of P2P Clients in a persistent group (GO)</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This is a list of P2P Clients (P2P Device Address) that have joined</span></span><br><span class="line"><span class="comment">	 * the persistent group. This is maintained on the GO for persistent</span></span><br><span class="line"><span class="comment">	 * group entries (disabled == 2).</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	u8 *p2p_client_list;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * num_p2p_clients - Number of entries in p2p_client_list</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">size_t</span> num_p2p_clients;</span><br><span class="line"></span><br><span class="line"><span class="meta">#<span class="meta-keyword">ifndef</span> P2P_MAX_STORED_CLIENTS</span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">define</span> P2P_MAX_STORED_CLIENTS 100</span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">endif</span> <span class="comment">/* P2P_MAX_STORED_CLIENTS */</span></span></span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * psk_list - Per-client PSKs (struct psk_list_entry)</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="class"><span class="keyword">struct</span> <span class="title">dl_list</span> <span class="title">psk_list</span>;</span></span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * p2p_group - Network generated as a P2P group (used internally)</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> p2p_group;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * p2p_persistent_group - Whether this is a persistent group</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> p2p_persistent_group;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * temporary - Whether this network is temporary and not to be saved</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> temporary;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * export_keys - Whether keys may be exported</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This attribute will be set when keys are determined through</span></span><br><span class="line"><span class="comment">	 * WPS or similar so that they may be exported.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> export_keys;</span><br><span class="line"></span><br><span class="line"><span class="meta">#<span class="meta-keyword">ifdef</span> ANDROID_P2P</span></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * assoc_retry - Number of times association should be retried.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> assoc_retry;</span><br><span class="line"><span class="meta">#<span class="meta-keyword">endif</span></span></span><br><span class="line"></span><br><span class="line"><span class="meta">#<span class="meta-keyword">ifdef</span> CONFIG_HT_OVERRIDES</span></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * disable_ht - Disable HT (IEEE 802.11n) for this network</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * By default, use it if it is available, but this can be configured</span></span><br><span class="line"><span class="comment">	 * to 1 to have it disabled.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> disable_ht;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * disable_ht40 - Disable HT40 for this network</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * By default, use it if it is available, but this can be configured</span></span><br><span class="line"><span class="comment">	 * to 1 to have it disabled.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> disable_ht40;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * disable_sgi - Disable SGI (Short Guard Interval) for this network</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * By default, use it if it is available, but this can be configured</span></span><br><span class="line"><span class="comment">	 * to 1 to have it disabled.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> disable_sgi;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * disable_max_amsdu - Disable MAX A-MSDU</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * A-MDSU will be 3839 bytes when disabled, or 7935</span></span><br><span class="line"><span class="comment">	 * when enabled (assuming it is otherwise supported)</span></span><br><span class="line"><span class="comment">	 * -1 (default) means do not apply any settings to the kernel.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> disable_max_amsdu;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * ampdu_factor - Maximum A-MPDU Length Exponent</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * Value: 0-3, see 7.3.2.56.3 in IEEE Std 802.11n-2009.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> ampdu_factor;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * ampdu_density - Minimum A-MPDU Start Spacing</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * Value: 0-7, see 7.3.2.56.3 in IEEE Std 802.11n-2009.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> ampdu_density;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * ht_mcs - Allowed HT-MCS rates, in ASCII hex: ffff0000...</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * By default (empty string): Use whatever the OS has configured.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">char</span> *ht_mcs;</span><br><span class="line"><span class="meta">#<span class="meta-keyword">endif</span> <span class="comment">/* CONFIG_HT_OVERRIDES */</span></span></span><br><span class="line"></span><br><span class="line"><span class="meta">#<span class="meta-keyword">ifdef</span> CONFIG_VHT_OVERRIDES</span></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * disable_vht - Disable VHT (IEEE 802.11ac) for this network</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * By default, use it if it is available, but this can be configured</span></span><br><span class="line"><span class="comment">	 * to 1 to have it disabled.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> disable_vht;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * vht_capa - VHT capabilities to use</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">unsigned</span> <span class="keyword">int</span> vht_capa;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * vht_capa_mask - mask for VHT capabilities</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">unsigned</span> <span class="keyword">int</span> vht_capa_mask;</span><br><span class="line"></span><br><span class="line">	<span class="keyword">int</span> vht_rx_mcs_nss_1, vht_rx_mcs_nss_2,</span><br><span class="line">	    vht_rx_mcs_nss_3, vht_rx_mcs_nss_4,</span><br><span class="line">	    vht_rx_mcs_nss_5, vht_rx_mcs_nss_6,</span><br><span class="line">	    vht_rx_mcs_nss_7, vht_rx_mcs_nss_8;</span><br><span class="line">	<span class="keyword">int</span> vht_tx_mcs_nss_1, vht_tx_mcs_nss_2,</span><br><span class="line">	    vht_tx_mcs_nss_3, vht_tx_mcs_nss_4,</span><br><span class="line">	    vht_tx_mcs_nss_5, vht_tx_mcs_nss_6,</span><br><span class="line">	    vht_tx_mcs_nss_7, vht_tx_mcs_nss_8;</span><br><span class="line"><span class="meta">#<span class="meta-keyword">endif</span> <span class="comment">/* CONFIG_VHT_OVERRIDES */</span></span></span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * ap_max_inactivity - Timeout in seconds to detect STA's inactivity</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This timeout value is used in AP mode to clean up inactive stations.</span></span><br><span class="line"><span class="comment">	 * By default: 300 seconds.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> ap_max_inactivity;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * dtim_period - DTIM period in Beacon intervals</span></span><br><span class="line"><span class="comment">	 * By default: 2</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> dtim_period;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * beacon_int - Beacon interval (default: 100 TU)</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">int</span> beacon_int;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * auth_failures - Number of consecutive authentication failures</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">unsigned</span> <span class="keyword">int</span> auth_failures;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * disabled_until - Network block disabled until this time if non-zero</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="class"><span class="keyword">struct</span> <span class="title">os_time</span> <span class="title">disabled_until</span>;</span></span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * parent_cred - Pointer to parent wpa_cred entry</span></span><br><span class="line"><span class="comment">	 *</span></span><br><span class="line"><span class="comment">	 * This pointer can be used to delete temporary networks when a wpa_cred</span></span><br><span class="line"><span class="comment">	 * that was used to create them is removed. This pointer should not be</span></span><br><span class="line"><span class="comment">	 * dereferences since it may not be updated in all cases.</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="keyword">void</span> *parent_cred;</span><br><span class="line">&#125;;</span><br></pre></td></tr></table></figure></div><div class="popular-posts-header">相关文章</div><ul class="popular-posts"><li class="popular-posts-item"><div class="popular-posts-title"><a href="/post/1797.html" rel="bookmark">WIFI配置中涉及到的相关名词</a></div></li><li class="popular-posts-item"><div class="popular-posts-title"><a href="/post/49326.html" rel="bookmark">关于WIFI的工作模式--AP MODE/STATION MODE/P2P MODE</a></div></li></ul><div class="post-widgets"><div id="needsharebutton-postbottom"><span class="btn"><i class="fa fa-share-alt" aria-hidden="true"></i></span></div></div><div><div style="text-align:center;color:#ccc;font-size:14px">-------------本文结束<i class="fa fa-paw"></i>感谢您的阅读-------------</div><div style="text-align:center;color:#ccc;font-size:16px"><script type="text/javascript" src="https://api.imjad.cn/hitokoto/?cat=&charset=utf-8&length=50&encode=js&fun=sync&source="></script><div id="hitokoto"><script>hitokoto()</script></div></div><div class="reward-container"><div></div> <button disable="enable" onclick="var qr = document.getElementById(&quot;qr&quot;); qr.style.display = (qr.style.display === 'none') ? 'block' : 'none';"> 打赏</button><div id="qr" style="display:none"><div style="display:inline-block"> <img src="/images/alipay.jpg" alt="Winddoing 支付宝"><p>支付宝</p></div></div></div><div><ul class="post-copyright"><li class="post-copyright-author"> <strong>本文作者：</strong> Winddoing</li><li class="post-copyright-link"> <strong>本文链接：</strong> <a href="http://winddoing.github.io/post/50085.html" title="wpa_supplicant源码分析--conf配置文件">http://winddoing.github.io/post/50085.html</a></li><li class="post-copyright-statement"> <strong>作者声明：</strong> 本博文为个人笔记, 由于个人能力有限，难免出现错误，欢迎大家批评指正。</li><li class="post-copyright-license"> <strong>版权声明：</strong> 本博客所有文章除特别声明外，均采用<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" rel="noopener" target="_blank"><i class="fa fa-fw fa-creative-commons"></i> BY-NC-SA</a> 许可协议。转载请注明出处！</li></ul></div><footer class="post-footer"><div class="post-tags"><a href="/tags/WIFI/" rel="tag"><i class="fa fa-tag"></i> WIFI</a></div><div class="post-nav"><div class="post-nav-item"><a href="/post/12156.html" rel="prev" title="linux下shell基础--获取脚本路径"><i class="fa fa-chevron-left"></i> linux下shell基础--获取脚本路径</a></div><div class="post-nav-item"> <a href="/post/32277.html" rel="next" title="RTCP协议">RTCP协议<i class="fa fa-chevron-right"></i></a></div></div></footer></div></article></div></div><div class="comments"><div id="lv-container" data-id="city" data-uid="MTAyMC8yOTM5OC81OTY2"></div></div><script>
  window.addEventListener('tabs:register', () => {
    let activeClass = CONFIG.comments.activeClass;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script></div><div class="toggle sidebar-toggle"><span class="toggle-line toggle-line-first"></span><span class="toggle-line toggle-line-middle"></span><span class="toggle-line toggle-line-last"></span></div><aside class="sidebar"><div class="sidebar-inner"><ul class="sidebar-nav motion-element"><li class="sidebar-nav-toc"> 文章目录</li><li class="sidebar-nav-overview"> 站点概览</li></ul><div class="post-toc-wrap sidebar-panel"><div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#wpa-supplicant-conf"><span class="nav-number">1.</span> <span class="nav-text">wpa_supplicant.conf</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#配置文件解析"><span class="nav-number">2.</span> <span class="nav-text">配置文件解析</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#可配置参数"><span class="nav-number">2.1.</span> <span class="nav-text">可配置参数</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#network节点"><span class="nav-number">2.2.</span> <span class="nav-text">network节点</span></a></li></ol></li></ol></div></div><div class="site-overview-wrap sidebar-panel"><div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" alt="Winddoing" src="/images/Winddoing.jpg"><p class="site-author-name" itemprop="name">Winddoing</p><div class="site-description" itemprop="description">失败缘于忽视细处，成功始于重视小事。</div></div><div class="site-state-wrap motion-element"><nav class="site-state"><div class="site-state-item site-state-posts"> <a href="/archives/"><span class="site-state-item-count">248</span> <span class="site-state-item-name">日志</span></a></div><div class="site-state-item site-state-categories"> <a href="/categories/"><span class="site-state-item-count">57</span> <span class="site-state-item-name">分类</span></a></div><div class="site-state-item site-state-tags"> <a href="/tags/"><span class="site-state-item-count">214</span> <span class="site-state-item-name">标签</span></a></div></nav></div><div class="links-of-author motion-element"><span class="links-of-author-item"><a href="https://github.com/Winddoing" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;Winddoing" rel="noopener" target="_blank"><i class="fa fa-fw fa-github"></i> GitHub</a></span><span class="links-of-author-item"><a href="https://gitee.com/winddoing" title="Gitee → https:&#x2F;&#x2F;gitee.com&#x2F;winddoing" rel="noopener" target="_blank"><i class="fa fa-fw fa-codiepie"></i> Gitee</a></span><span class="links-of-author-item"><a href="mailto:winddoing@sina.cn" title="E-Mail → mailto:winddoing@sina.cn" rel="noopener" target="_blank"><i class="fa fa-fw fa-envelope"></i> E-Mail</a></span><span class="links-of-author-item"><a href="https://stackoverflow.com/users/9567361/winddoing" title="StackOverflow → https:&#x2F;&#x2F;stackoverflow.com&#x2F;users&#x2F;9567361&#x2F;winddoing" rel="noopener" target="_blank"><i class="fa fa-fw fa-stack-overflow"></i> StackOverflow</a></span><span class="links-of-author-item"><a href="https://travis-ci.org/Winddoing/Winddoing.github.io" title="Travis CI → https:&#x2F;&#x2F;travis-ci.org&#x2F;Winddoing&#x2F;Winddoing.github.io" rel="noopener" target="_blank"><i class="fa fa-fw fa-terminal"></i> Travis CI</a></span></div><div class="cc-license motion-element" itemprop="license"> <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" class="cc-opacity" rel="noopener" target="_blank"><img src="/images/cc-by-nc-sa.svg" alt="Creative Commons"></a></div><div class="links-of-blogroll motion-element"><div class="links-of-blogroll-title"><i class="fa fa-fw fa-link"></i> Links</div><ul class="links-of-blogroll-list"><li class="links-of-blogroll-item"> <a href="https://winddoing.gitbooks.io/embedded_notes/content/" title="https:&#x2F;&#x2F;winddoing.gitbooks.io&#x2F;embedded_notes&#x2F;content&#x2F;" rel="noopener" target="_blank">嵌入式相关</a></li><li class="links-of-blogroll-item"> <a href="http://blog.csdn.net/sdreamq" title="http:&#x2F;&#x2F;blog.csdn.net&#x2F;sdreamq" rel="noopener" target="_blank">CSDN</a></li><li class="links-of-blogroll-item"> <a href="http://www.wowotech.net/" title="http:&#x2F;&#x2F;www.wowotech.net&#x2F;" rel="noopener" target="_blank">蜗窝科技</a></li><li class="links-of-blogroll-item"> <a href="https://blog.csdn.net/xiongxianze" title="https:&#x2F;&#x2F;blog.csdn.net&#x2F;xiongxianze" rel="noopener" target="_blank">xiongxianze</a></li></ul></div><div id="days"></div><script>function show_date_time(){window.setTimeout("show_date_time()",1e3),BirthDay=new Date("02/26/2014 15:00:00"),today=new Date,timeold=today.getTime()-BirthDay.getTime(),sectimeold=timeold/1e3,secondsold=Math.floor(sectimeold),msPerDay=864e5,e_daysold=timeold/msPerDay,daysold=Math.floor(e_daysold),e_hrsold=24*(e_daysold-daysold),hrsold=setzero(Math.floor(e_hrsold)),e_minsold=60*(e_hrsold-hrsold),minsold=setzero(Math.floor(60*(e_hrsold-hrsold))),seconds=setzero(Math.floor(60*(e_minsold-minsold))),document.getElementById("days").innerHTML="已运行"+daysold+"天"+hrsold+"小时"+minsold+"分"+seconds+"秒"}function setzero(e){return e<10&&(e="0"+e),e}show_date_time()</script></div></div></aside><div id="sidebar-dimmer"></div></div></main><footer class="footer"><div class="footer-inner"><div class="copyright"> &copy; 2014 – <span itemprop="copyrightYear">2020</span><span class="with-love" id="heart"><i class="fa fa-heartbeat"></i></span> <span class="author" itemprop="copyrightHolder">Winddoing</span> <span class="post-meta-divider">|</span><span class="post-meta-item-icon"><i class="fa fa-area-chart"></i></span> <span title="站点总字数">652k</span> <span class="post-meta-divider">|</span><span class="post-meta-item-icon"><i class="fa fa-coffee"></i></span> <span title="站点阅读时长">9:53</span></div><div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> 强力驱动 v3.9.0</div> <span class="post-meta-divider">|</span><div class="theme-info">主题 – <a href="https://mist.theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Mist</a> v7.7.0</div><div class="busuanzi-count"><script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script><span class="post-meta-item" id="busuanzi_container_site_uv" style="display:none"><span class="post-meta-item-icon"><i class="fa fa-user"></i></span><span class="site-uv" title="总访客量"><span id="busuanzi_value_site_uv"></span></span></span> <span class="post-meta-divider">|</span><span class="post-meta-item" id="busuanzi_container_site_pv" style="display:none"><span class="post-meta-item-icon"><i class="fa fa-eye"></i></span><span class="site-pv" title="总访问量"><span id="busuanzi_value_site_pv"></span></span></span></div><div style="display:inline"><script type="text/javascript">var cnzz_protocol="https:"==document.location.protocol?" https://":" http://";document.write(unescape("%3Cspan id='cnzz_stat_icon_1254703532'%3E%3C/span%3E%3Cscript src='"+cnzz_protocol+"s95.cnzz.com/z_stat.php%3Fid%3D1254703532%26show%3Dpic' type='text/javascript'%3E%3C/script%3E"))</script></div><script>
  function leancloudSelector(url) {
    url = encodeURI(url);
    return document.getElementById(url).querySelector('.leancloud-visitors-count');
  }
  if (CONFIG.page.isPost) {
    function addCount(Counter) {
      var visitors = document.querySelector('.leancloud_visitors');
      var url = decodeURI(visitors.getAttribute('id'));
      var title = visitors.getAttribute('data-flag-title');

      Counter('get', `/classes/Counter?where=${JSON.stringify({ url })}`)
        .then(response => response.json())
        .then(({ results }) => {
          if (results.length > 0) {
            var counter = results[0];
            Counter('put', '/classes/Counter/' + counter.objectId, { time: { '__op': 'Increment', 'amount': 1 } })
              .then(response => response.json())
              .then(() => {
                leancloudSelector(url).innerText = counter.time + 1;
              })
              .catch(error => {
                console.error('Failed to save visitor count', error);
              })
          } else {
              Counter('post', '/classes/Counter', { title: title, url: url, time: 1 })
                .then(response => response.json())
                .then(() => {
                  leancloudSelector(url).innerText = 1;
                })
                .catch(error => {
                  console.error('Failed to create', error);
                });
          }
        })
        .catch(error => {
          console.error('LeanCloud Counter Error', error);
        });
    }
  } else {
    function showTime(Counter) {
      var visitors = document.querySelectorAll('.leancloud_visitors');
      var entries = [...visitors].map(element => {
        return decodeURI(element.getAttribute('id'));
      });

      Counter('get', `/classes/Counter?where=${JSON.stringify({ url: { '$in': entries } })}`)
        .then(response => response.json())
        .then(({ results }) => {
          if (results.length === 0) {
            document.querySelectorAll('.leancloud_visitors .leancloud-visitors-count').forEach(element => {
              element.innerText = 0;
            });
            return;
          }
          for (let item of results) {
            let { url, time } = item;
            leancloudSelector(url).innerText = time;
          }
          for (let url of entries) {
            var element = leancloudSelector(url);
            if (element.innerText == '') {
              element.innerText = 0;
            }
          }
        })
        .catch(error => {
          console.error('LeanCloud Counter Error', error);
        });
    }
  }

  fetch('https://app-router.leancloud.cn/2/route?appId=Q8qpjA3fOO7FEUBqcmcQFptF-gzGzoHsz')
    .then(response => response.json())
    .then(({ api_server }) => {
      var Counter = (method, url, data) => {
        return fetch(`https://${api_server}/1.1${url}`, {
          method: method,
          headers: {
            'X-LC-Id': 'Q8qpjA3fOO7FEUBqcmcQFptF-gzGzoHsz',
            'X-LC-Key': 'tgUTq5bX3fVmn916EMRe65eJ',
            'Content-Type': 'application/json',
          },
          body: JSON.stringify(data)
        });
      };
      if (CONFIG.page.isPost) {
        if (CONFIG.hostname !== location.hostname) return;
        addCount(Counter);
      } else if (document.querySelectorAll('.post-title-link').length >= 1) {
        showTime(Counter);
      }
    });
  </script></div></footer></div><script src="/lib/anime.min.js"></script><script src="/lib/velocity/velocity.min.js"></script><script src="/lib/velocity/velocity.ui.min.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/schemes/muse.js"></script><script src="/js/next-boot.js"></script><script>!function(){var t=document.createElement("script"),e=window.location.protocol.split(":")[0];t.src="https"===e?"https://zz.bdstatic.com/linksubmit/push.js":"http://push.zhanzhang.baidu.com/push.js";var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(t,s)}()</script><script src="/js/local-search.js"></script><script>
if (document.querySelectorAll('pre.mermaid').length) {
  NexT.utils.getScript('//cdn.jsdelivr.net/npm/mermaid@8/dist/mermaid.min.js', () => {
    mermaid.initialize({
      theme: 'forest',
      logLevel: 3,
      flowchart: { curve: 'linear' },
      gantt: { axisFormat: '%m/%d/%Y' },
      sequence: { actorMargin: 50 }
    });
  }, window.mermaid);
}
</script><script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-needmoreshare2@1/needsharebutton.min.js"></script><script>pbOptions={iconStyle:"default",boxForm:"horizontal",position:"bottomCenter",networks:"Weibo,Wechat,QQZone,Twitter,Facebook,Evernote"},new needShareButton("#needsharebutton-postbottom",pbOptions)</script><script>
NexT.utils.loadComments(document.querySelector('#lv-container'), () => {
  window.livereOptions = {
    refer: location.pathname.replace(CONFIG.root, '').replace('index.html', '')
  };
  (function(d, s) {
    var j, e = d.getElementsByTagName(s)[0];
    if (typeof LivereTower === 'function') { return; }
    j = d.createElement(s);
    j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
    j.async = true;
    e.parentNode.insertBefore(j, e);
  })(document, 'script');
});
</script></body></html>